Salome HOME
Merge from V6_main 28/02/2013
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_BuildCompoundDlg.h
1 // Copyright (C) 2007-2012  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_BuildCompoundDlg.h
25 // Author : Alexander KOVALEV, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_BUILDCOMPOUNDDLG_H
28 #define SMESHGUI_BUILDCOMPOUNDDLG_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_Gen)
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
40
41 class QGroupBox;
42 class QLabel;
43 class QLineEdit;
44 class QPushButton;
45 class QRadioButton;
46 class QCheckBox;
47 class QComboBox;
48 class SMESHGUI;
49 class SMESHGUI_SpinBox;
50 class LightApp_SelectionMgr;
51 class SUIT_SelectionFilter;
52
53 //=================================================================================
54 // class    : SMESHGUI_BuildCompoundDlg
55 // purpose  :
56 //=================================================================================
57 class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
58 {
59   Q_OBJECT;
60
61 public:
62
63   SMESHGUI_BuildCompoundDlg( SMESHGUI* );
64   ~SMESHGUI_BuildCompoundDlg();
65
66 public:
67   static QString          GetDefaultName( const QString& );
68
69 private:
70   void                    Init();
71   void                    enterEvent( QEvent* );             /* mouse enter the QWidget */
72   void                    keyPressEvent( QKeyEvent* );
73
74   bool                    isValid();
75
76   void                    setIsApplyAndClose( const bool theFlag );
77   bool                    isApplyAndClose() const;
78   
79 private:
80   SMESHGUI*               mySMESHGUI;     /* Current SMESHGUI object */
81   LightApp_SelectionMgr*  mySelectionMgr; /* User shape selection */
82
83   SMESH::SMESH_Mesh_var   myMesh;
84   SUIT_SelectionFilter*   myMeshFilter;
85   SMESH::mesh_array_var   myMeshArray;
86
87   // Widgets
88   QGroupBox*              GroupConstructors;
89   QRadioButton*           Constructor1;
90
91   QGroupBox*              GroupButtons;
92   QPushButton*            buttonOk;
93   QPushButton*            buttonCancel;
94   QPushButton*            buttonApply;
95   QPushButton*            buttonHelp;
96
97   QGroupBox*              GroupName;
98   QLabel*                 TextLabelName;
99   QLineEdit*              LineEditName;
100
101   QGroupBox*              GroupArgs;
102   QLabel*                 TextLabelMeshes;
103   QPushButton*            SelectButton;
104   QLineEdit*              LineEditMeshes;
105   QLabel*                 TextLabelUnion;
106   QComboBox*              ComboBoxUnion;
107   QCheckBox*              CheckBoxCommon;
108   QCheckBox*              CheckBoxMerge;
109   QLabel*                 TextLabelTol;
110   SMESHGUI_SpinBox*       SpinBoxTol;
111
112   QString                 myHelpFileName;
113
114   bool                    myIsApplyAndClose;
115
116 protected slots:
117   virtual void            reject();
118
119 private slots:
120   void                    ClickOnOk();
121   bool                    ClickOnApply();
122   void                    ClickOnHelp();
123   void                    SelectionIntoArgument();
124   void                    DeactivateActiveDialog();
125   void                    ActivateThisDialog();
126   void                    onSelectMerge( bool );
127 };
128
129 #endif // SMESHGUI_BUILDCOMPOUNDDLG_H