Salome HOME
PR: merged from V5_1_4rc1
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ScaleDlg.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // SMESH SMESHGUI : GUI for SMESH component
21 // File   : SMESHGUI_ScaleDlg.h
22 // Author : Sergey Kuul, Open CASCADE S.A.S.
23 //
24 #ifndef SMESHGUI_SCALEDLG_H
25 #define SMESHGUI_SCALEDLG_H
26
27 // SMESH includes
28 #include "SMESH_SMESHGUI.hxx"
29
30 // Qt includes
31 #include <QDialog>
32
33 // IDL includes
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36
37 class QButtonGroup;
38 class QGroupBox;
39 class QLabel;
40 class QLineEdit;
41 class QPushButton;
42 class QRadioButton;
43 class QCheckBox;
44 class SMESHGUI;
45 class SMESHGUI_IdValidator;
46 class SMESHGUI_SpinBox;
47 class SMESHGUI_FilterDlg;
48 class SMESH_Actor;
49 class SVTK_Selector;
50 class LightApp_SelectionMgr;
51 class SMESH_LogicalFilter;
52
53 //=================================================================================
54 // class    : SMESHGUI_ScaleDlg
55 // purpose  :
56 //=================================================================================
57 class SMESHGUI_EXPORT SMESHGUI_ScaleDlg : public QDialog
58
59   Q_OBJECT
60
61 public:
62   SMESHGUI_ScaleDlg( SMESHGUI* );
63   ~SMESHGUI_ScaleDlg();
64
65 private:
66   void                   Init( bool = true );
67   void                   closeEvent( QCloseEvent* );
68   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
69   void                   hideEvent( QHideEvent* );        /* ESC key */
70   void                   keyPressEvent( QKeyEvent* );
71   int                    GetConstructorId();
72   void                   setNewMeshName();
73
74   bool                   isValid();
75
76   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
77   SMESHGUI_IdValidator*  myIdValidator;
78   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
79   QString                myElementsId;
80   int                    myNbOkElements;          /* to check when elements are defined */
81
82   SVTK_Selector*         mySelector;
83
84   QWidget*               myEditCurrentArgument;
85
86   bool                   myBusy;
87   SMESH::SMESH_Mesh_var  myMesh;
88   SMESH_Actor*           myActor;
89   SMESH_LogicalFilter*   myMeshOrSubMeshOrGroupFilter;
90
91   SMESH::SMESH_IDSource_var mySelectedObject;
92
93   QGroupBox*             ConstructorsBox;
94   QButtonGroup*          GroupConstructors;
95   QRadioButton*          RadioButton1;
96   QRadioButton*          RadioButton2;
97   QGroupBox*             GroupButtons;
98   QPushButton*           buttonOk;
99   QPushButton*           buttonCancel;
100   QPushButton*           buttonApply;
101   QPushButton*           buttonHelp;
102   QGroupBox*             GroupArguments;
103   QLabel*                TextLabelElements;
104   QPushButton*           SelectElementsButton;
105   QLineEdit*             LineEditElements;
106   QCheckBox*             CheckBoxMesh;
107   QLabel*                TextLabel1;
108   QPushButton*           SelectButton1;
109   QLabel*                TextLabel1_1;
110   SMESHGUI_SpinBox*      SpinBox1_1;
111   QLabel*                TextLabel1_2;
112   SMESHGUI_SpinBox*      SpinBox1_2;
113   QLabel*                TextLabel1_3;
114   SMESHGUI_SpinBox*      SpinBox1_3;
115   QLabel*                TextLabel2;
116   SMESHGUI_SpinBox*      SpinBox_FX;
117   QLabel*                TextLabel3;
118   SMESHGUI_SpinBox*      SpinBox_FY;
119   QLabel*                TextLabel4;
120   SMESHGUI_SpinBox*      SpinBox_FZ;
121   QGroupBox*             ActionBox;
122   QButtonGroup*          ActionGroup;
123   QCheckBox*             MakeGroupsCheck;
124   QLineEdit*             LineEditNewMesh;
125
126   QString                myHelpFileName;
127
128   QPushButton*           myFilterBtn;
129   SMESHGUI_FilterDlg*    myFilterDlg;
130    
131 private slots:
132   void                   ConstructorsClicked( int );
133   void                   ClickOnOk();
134   void                   ClickOnCancel();
135   bool                   ClickOnApply();
136   void                   ClickOnHelp();
137   void                   SetEditCurrentArgument();
138   void                   SelectionIntoArgument();
139   void                   DeactivateActiveDialog();
140   void                   ActivateThisDialog();
141   void                   onTextChange( const QString& );
142   void                   onSelectMesh( bool );
143   void                   onActionClicked( int );
144   void                   setFilters();
145 };
146
147 #endif // SMESHGUI_SCALEDLG_H