Salome HOME
Copyright update 2020
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionAlongPathDlg.h
1 // Copyright (C) 2007-2020  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, or (at your option) any later version.
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 // SMESH SMESHGUI : GUI for SMESH component
24 // File   : SMESHGUI_ExtrusionAlongPathDlg.h
25 // Author : Vadim SANDLER, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_EXTRUSIONALONGPATHDLG_H
28 #define SMESHGUI_EXTRUSIONALONGPATHDLG_H
29
30 // SMESH includes
31 #include "SMESH_SMESHGUI.hxx"
32 #include "SMESHGUI_PreviewDlg.h"
33
34 // IDL includes
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37
38 class QButtonGroup;
39 class QRadioButton;
40 class QGroupBox;
41 class QLabel;
42 class QToolButton;
43 class QLineEdit;
44 class QCheckBox;
45 class QListWidget;
46 class QPushButton;
47
48 class LightApp_SelectionMgr;
49 class SMESHGUI;
50 class SMESHGUI_3TypesSelector;
51 class SMESHGUI_FilterDlg;
52 class SMESHGUI_IdValidator;
53 class SMESHGUI_SpinBox;
54 class SMESH_Actor;
55 class SUIT_SelectionFilter;
56 class SVTK_Selector;
57
58 //=================================================================================
59 // class    : SMESHGUI_ExtrusionAlongPathDlg
60 // purpose  :
61 //=================================================================================
62 class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public SMESHGUI_PreviewDlg
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   void                      SetEditCurrentArgument( QPushButton* );
80
81   bool                      isValid();
82   bool                      isValuesValid();
83   
84   SMESH::double_array_var   getAngles();
85   SMESH::double_array_var   getScales();
86
87   void                      updateLinearAngles();
88   
89   SMESHGUI_IdValidator*     myIdValidator;
90   LightApp_SelectionMgr*    mySelectionMgr;        /* User shape selection */
91   SVTK_Selector*            mySelector;
92   QWidget*                  myEditCurrentArgument; /* Current  argument */
93
94   bool                      myBusy;
95   SMESH::SMESH_IDSource_var myPath;
96   SUIT_SelectionFilter*     myPathMeshFilter;
97   QList<double>             myAnglesList;
98   QList<double>             myScalesList;
99
100   // widgets
101   SMESHGUI_3TypesSelector*  SelectorWdg;
102   QGroupBox*                GroupArguments;
103   QGroupBox*                PathGrp;
104   QPushButton*              SelectPathMeshButton;
105   QLineEdit*                PathMeshLineEdit;
106   QPushButton*              SelectStartPointButton;
107   QLineEdit*                StartPointLineEdit;
108
109   QCheckBox*                LinearAnglesCheck;
110   QGroupBox*                AnglesGrp;
111   QListWidget*              AnglesList;
112   QToolButton*              AddAngleButton;
113   QToolButton*              RemoveAngleButton;
114   SMESHGUI_SpinBox*         AngleSpin;
115
116   QCheckBox*                LinearScalesCheck;
117   QGroupBox*                ScalesGrp;
118   QListWidget*              ScalesList;
119   QToolButton*              AddScaleButton;
120   QToolButton*              RemoveScaleButton;
121   SMESHGUI_SpinBox*         ScaleSpin;
122
123   QGroupBox*                BasePointGrp;
124   QPushButton*              SelectBasePointButton;
125   SMESHGUI_SpinBox*         XSpin;
126   SMESHGUI_SpinBox*         YSpin;
127   SMESHGUI_SpinBox*         ZSpin;
128   QCheckBox*                MakeGroupsCheck;
129
130   QGroupBox*                GroupButtons;
131   QPushButton*              OkButton;
132   QPushButton*              ApplyButton;
133   QPushButton*              CloseButton;
134   QPushButton*              HelpButton;
135
136   QString                   myHelpFileName;
137
138 protected slots:
139   void                      reject();
140   virtual void              onDisplaySimulation( bool );
141
142 private slots:
143   void                      ClickOnOk();
144   bool                      ClickOnApply();
145   void                      ClickOnHelp();
146   void                      CheckIsEnable();
147   void                      SetEditCurrentArgument();
148   void                      SelectionIntoArgument();
149   void                      DeactivateActiveDialog();
150   void                      ActivateThisDialog();
151   void                      onTextChange( const QString& );
152   void                      OnAngleAdded();
153   void                      OnAngleRemoved();
154   void                      onOpenView();
155   void                      onCloseView();
156 };
157
158 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H