Salome HOME
Merge from V5_1_main 14/05/2010
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SmoothingDlg.h
1 //  Copyright (C) 2007-2010  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
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File   : SMESHGUI_SmoothingDlg.h
25 // Author : Michael ZORIN, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_SMOOTHINGDLG_H
28 #define SMESHGUI_SMOOTHINGDLG_H
29
30 // SMESH includes
31 #include "SMESH_SMESHGUI.hxx"
32
33 // Qt includes
34 #include <QDialog>
35
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39
40 class QGroupBox;
41 class QLabel;
42 class QLineEdit;
43 class QPushButton;
44 class QRadioButton;
45 class QComboBox;
46 class QCheckBox;
47 class SMESHGUI;
48 class SalomeApp_IntSpinBox;
49 class SMESHGUI_IdValidator;
50 class SMESHGUI_SpinBox;
51 class SMESHGUI_FilterDlg;
52 class SMESH_Actor;
53 class SVTK_Selector;
54 class LightApp_SelectionMgr;
55 class SMESH_LogicalFilter;
56
57 //=================================================================================
58 // class    : SMESHGUI_SmoothingDlg
59 // purpose  :
60 //=================================================================================
61 class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog
62
63   Q_OBJECT
64
65 public:
66   SMESHGUI_SmoothingDlg( SMESHGUI* );
67   ~SMESHGUI_SmoothingDlg();
68
69 private:
70   void                   Init();
71   void                   closeEvent( QCloseEvent* );
72   void                   enterEvent( QEvent* );        /* mouse enter the QWidget */
73   void                   hideEvent( QHideEvent* );     /* ESC key */
74   void                   keyPressEvent( QKeyEvent* );
75   void                   setFilters( const bool theIsElem );
76
77   bool                   isValid();
78   
79   SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
80   SMESHGUI_IdValidator*  myIdValidator;
81   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
82   QString                myElementsId;
83   int                    myNbOkElements;          /* to check when elements are defined */
84   int                    myNbOkNodes;             /* to check when fixed nodes are defined */
85   int                    myConstructorId;         /* Current constructor id = radio button id */
86   QLineEdit*             myEditCurrentArgument;   /* Current  LineEdit */
87   SVTK_Selector*         mySelector;
88
89   SMESH::SMESH_IDSource_var mySelectedObject;
90
91   bool                   myBusy;
92   SMESH::SMESH_Mesh_var  myMesh;
93   SMESH_Actor*           myActor;
94   SMESH_LogicalFilter*   myMeshOrSubMeshOrGroupFilter;
95
96   QGroupBox*             GroupConstructors;
97   QRadioButton*          Constructor1;
98   QGroupBox*             GroupButtons;
99   QPushButton*           buttonOk;
100   QPushButton*           buttonCancel;
101   QPushButton*           buttonApply;
102   QPushButton*           buttonHelp;
103   QGroupBox*             GroupArguments;
104   QLabel*                TextLabelElements;
105   QPushButton*           SelectElementsButton;
106   QLineEdit*             LineEditElements;
107   QCheckBox*             CheckBoxMesh;
108   QLabel*                TextLabelNodes;
109   QPushButton*           SelectNodesButton;
110   QLineEdit*             LineEditNodes;
111   QLabel*                TextLabelMethod;
112   QComboBox*             ComboBoxMethod;
113   QLabel*                TextLabelLimit;
114   SalomeApp_IntSpinBox*  SpinBox_IterationLimit;
115   QLabel*                TextLabelAspectRatio;
116   SMESHGUI_SpinBox*      SpinBox_AspectRatio;
117   QCheckBox*             CheckBoxParametric;
118
119   QString                myHelpFileName;
120
121   QPushButton*           myElemFilterBtn;
122   SMESHGUI_FilterDlg*    myFilterDlg;
123    
124 private slots:
125   void                   ClickOnOk();
126   void                   ClickOnCancel();
127   bool                   ClickOnApply();
128   void                   ClickOnHelp();
129   void                   SetEditCurrentArgument();
130   void                   SelectionIntoArgument();
131   void                   DeactivateActiveDialog();
132   void                   ActivateThisDialog();
133   void                   onTextChange( const QString& );
134   void                   onSelectMesh( bool );
135   void                   setElemFilters();
136   void                   setNodeFilters();
137 };
138
139 #endif // SMESHGUI_SMOOTHINGDLG_H