Salome HOME
Nerge with PAL/SALOME 2.1.0d
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SymmetryDlg.h
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESHGUI_SymmetryDlg.h
25 //  Author : Michael ZORIN
26 //  Module : SMESH
27 //  $Header: 
28
29 #ifndef DIALOGBOX_SYMMETRY_H
30 #define DIALOGBOX_SYMMETRY_H
31
32 #include "SALOME_Selection.h"
33 #include "SMESH_LogicalFilter.hxx"
34
35 // QT Includes
36 #include <qdialog.h>
37
38 class QGridLayout; 
39 class QHBoxLayout;
40 class QButtonGroup;
41 class QGroupBox;
42 class QLabel;
43 class QLineEdit;
44 class QPushButton;
45 class QRadioButton;
46 class QCheckBox;
47 class SMESHGUI_SpinBox;
48 class SMESHGUI;
49 class SMESH_Actor;
50
51 // IDL Headers
52 #include <SALOMEconfig.h>
53 #include CORBA_SERVER_HEADER(SMESH_Mesh)
54
55
56 //=================================================================================
57 // class    : SMESHGUI_SymmetryDlg
58 // purpose  :
59 //=================================================================================
60 class SMESHGUI_SymmetryDlg : public QDialog
61
62     Q_OBJECT
63
64 public:
65     SMESHGUI_SymmetryDlg( QWidget* parent = 0, const char* name = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0 );
66     ~SMESHGUI_SymmetryDlg();
67
68 private:
69
70     void Init( bool ResetControls = true ) ;
71     void closeEvent( QCloseEvent* e ) ;
72     void enterEvent ( QEvent * ) ;                          /* mouse enter the QWidget */
73     void hideEvent ( QHideEvent * );                        /* ESC key */
74     int GetConstructorId();
75     bool IsMirrorOk();
76     
77     SMESHGUI*                     mySMESHGUI ;              /* Current SMESHGUI object */
78     SALOME_Selection*             mySelection ;             /* User shape selection */
79     int                           myNbOkElements ;          /* to check when elements are defined */
80     QString                       myElementsId;
81
82     QWidget*                      myEditCurrentArgument;    /* Current  LineEdit */
83     
84     bool                          myBusy;
85     SMESH::SMESH_Mesh_var         myMesh;
86     SMESH_Actor*                  myActor;
87     Handle(SMESH_LogicalFilter)   myMeshOrSubMeshOrGroupFilter;
88     
89     QButtonGroup* GroupConstructors;
90     QRadioButton* RadioButton1;
91     QRadioButton* RadioButton2;
92     QRadioButton* RadioButton3;
93     QGroupBox* GroupButtons;
94     QPushButton* buttonOk;
95     QPushButton* buttonCancel;
96     QPushButton* buttonApply;
97     QGroupBox* GroupArguments;
98     QGroupBox* GroupMirror;
99     QLabel* TextLabelElements;
100     QPushButton* SelectElementsButton;
101     QLineEdit* LineEditElements;
102     QCheckBox* CheckBoxMesh;
103
104     QLabel* TextLabelPoint;
105     QPushButton* SelectPointButton;
106     QLabel* TextLabelX;
107     SMESHGUI_SpinBox* SpinBox_X;
108     QLabel* TextLabelY;
109     SMESHGUI_SpinBox* SpinBox_Y;
110     QLabel* TextLabelZ;
111     SMESHGUI_SpinBox* SpinBox_Z;
112     QLabel* TextLabelVector;
113     QPushButton* SelectVectorButton;
114     QLabel* TextLabelDX;
115     SMESHGUI_SpinBox* SpinBox_DX;
116     QLabel* TextLabelDY;
117     SMESHGUI_SpinBox* SpinBox_DY;
118     QLabel* TextLabelDZ;
119     SMESHGUI_SpinBox* SpinBox_DZ;
120     
121     QCheckBox* CheckBoxCopy;
122    
123     private slots:
124
125     void ConstructorsClicked(int constructorId);
126     void ClickOnOk();
127     void ClickOnCancel();
128     void ClickOnApply();
129     void SetEditCurrentArgument() ;
130     void SelectionIntoArgument() ;
131     void DeactivateActiveDialog() ;
132     void ActivateThisDialog() ;
133     void onTextChange(const QString&);
134     void onSelectMesh(bool toSelectMesh);
135     void onVectorChanged();
136     
137 protected:
138     QGridLayout* SMESHGUI_SymmetryDlgLayout;
139     QGridLayout* GroupConstructorsLayout;
140     QGridLayout* GroupButtonsLayout;
141     QGridLayout* GroupArgumentsLayout;
142 };
143
144 #endif // DIALOGBOX_SYMMETRY_H