Salome HOME
Merge from BR_phase16 branch (09/12/09)
[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, Open CASCADE S.A.S.
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_IdValidator;
52 class SMESHGUI_SpinBox;
53 class SMESHGUI_FilterDlg;
54 class SVTK_Selector;
55 class LightApp_SelectionMgr;
56 class SUIT_SelectionFilter;
57
58 //=================================================================================
59 // class    : SMESHGUI_ExtrusionAlongPathDlg
60 // purpose  :
61 //=================================================================================
62 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog
63 {
64   Q_OBJECT
65
66   class SetBusy;
67   friend class SetBusy;
68
69 public:
70   SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* );
71   ~SMESHGUI_ExtrusionAlongPathDlg();
72
73   bool                      eventFilter( QObject*, QEvent* );
74
75 private:
76   void                      Init( bool = true );
77   void                      enterEvent( QEvent* );                           /* mouse enter the QWidget */
78   void                      keyPressEvent( QKeyEvent* );
79   int                       GetConstructorId();
80   void                      SetEditCurrentArgument( QToolButton* );
81
82   bool                      isValid();
83
84   void                      updateLinearAngles();
85   
86   SMESHGUI*                 mySMESHGUI;            /* Current SMESHGUI object */
87   SMESHGUI_IdValidator*     myIdValidator;
88   LightApp_SelectionMgr*    mySelectionMgr;        /* User shape selection */
89   SVTK_Selector*            mySelector;
90
91   QWidget*                  myEditCurrentArgument; /* Current  argument */
92
93   bool                      myBusy;
94   SMESH::SMESH_Mesh_var     myMesh;
95   SMESH_Actor*              myMeshActor;
96   SMESH::SMESH_IDSource_var myIDSource;
97   //SMESH::SMESH_Mesh_var     myPathMesh;
98   SMESH::SMESH_IDSource_var myPath;
99   //GEOM::GEOM_Object_var     myPathShape;
100   SUIT_SelectionFilter*     myElementsFilter;
101   SUIT_SelectionFilter*     myPathMeshFilter;
102   int                       myType;
103   QList<double>             myAnglesList;
104
105   // widgets
106   QGroupBox*                ConstructorsBox;
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   QToolButton*              SelectPathMeshButton;
118   QLineEdit*                PathMeshLineEdit;
119   //QToolButton*              SelectPathShapeButton;
120   //QLineEdit*                PathShapeLineEdit;
121   QToolButton*              SelectStartPointButton;
122   QLineEdit*                StartPointLineEdit;
123   QCheckBox*                LinearAnglesCheck;
124   QGroupBox*                AnglesGrp;
125   QListWidget*              AnglesList;
126   QToolButton*              AddAngleButton;
127   QToolButton*              RemoveAngleButton;
128   SMESHGUI_SpinBox*         AngleSpin;
129   QGroupBox*                BasePointGrp;
130   QToolButton*              SelectBasePointButton;
131   SMESHGUI_SpinBox*         XSpin;
132   SMESHGUI_SpinBox*         YSpin;
133   SMESHGUI_SpinBox*         ZSpin;
134   QCheckBox*                MakeGroupsCheck;
135
136   QGroupBox*                GroupButtons;
137   QPushButton*              OkButton;
138   QPushButton*              ApplyButton;
139   QPushButton*              CloseButton;
140   QPushButton*              HelpButton;
141
142   QString                   myHelpFileName;
143
144   QPushButton*              myFilterBtn;
145   SMESHGUI_FilterDlg*       myFilterDlg;
146    
147 protected slots:
148   void                      reject();
149
150 private slots:
151   void                      ConstructorsClicked( int );
152   void                      ClickOnOk();
153   bool                      ClickOnApply();
154   void                      ClickOnHelp();
155   void                      SetEditCurrentArgument();
156   void                      SelectionIntoArgument();
157   void                      DeactivateActiveDialog();
158   void                      ActivateThisDialog();
159   void                      onTextChange( const QString& );
160   void                      onSelectMesh();
161   void                      OnAngleAdded();
162   void                      OnAngleRemoved();
163   void                      setFilters();
164 };
165
166 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H