Salome HOME
fix PAL8469. Updating the global mesh icon when local hypotheses are edited
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePatternDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
3 // \r
4 //  This library is free software; you can redistribute it and/or \r
5 //  modify it under the terms of the GNU Lesser General Public \r
6 //  License as published by the Free Software Foundation; either \r
7 //  version 2.1 of the License. \r
8 // \r
9 //  This library is distributed in the hope that it will be useful, \r
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of \r
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU \r
12 //  Lesser General Public License for more details. \r
13 // \r
14 //  You should have received a copy of the GNU Lesser General Public \r
15 //  License along with this library; if not, write to the Free Software \r
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA \r
17 // \r
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
19 //\r
20 //\r
21 //\r
22 //  File   : SMESHGUI_CreatePatternDlg.h\r
23 //  Author : Sergey LITONIN\r
24 //  Module : SMESH\r
25 \r
26 \r
27 #ifndef SMESHGUI_CreatePatternDlg_H\r
28 #define SMESHGUI_CreatePatternDlg_H\r
29 \r
30 #include <qdialog.h>\r
31 \r
32 // IDL Headers\r
33 #include <SALOMEconfig.h>\r
34 #include CORBA_SERVER_HEADER(GEOM_Gen)\r
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)\r
36 #include CORBA_SERVER_HEADER(SMESH_Pattern)\r
37 \r
38 class SMESHGUI_PatternWidget;\r
39 class QCloseEvent;\r
40 class QFrame;\r
41 class QLineEdit;\r
42 class SMESHGUI_SpinBox;\r
43 class QPushButton;\r
44 class SALOME_Selection;\r
45 class QRadioButton;\r
46 class QCheckBox;\r
47 class QButtonGroup;\r
48 class QLabel;\r
49 \r
50 /*\r
51   Class       : SMESHGUI_CreatePatternDlg\r
52   Description : Dialog to specify filters for VTK viewer\r
53 */\r
54 \r
55 class SMESHGUI_CreatePatternDlg : public QDialog\r
56 {\r
57   Q_OBJECT\r
58 \r
59 public:\r
60   \r
61   enum { Type_2d, Type_3d };\r
62 \r
63 public:\r
64                               SMESHGUI_CreatePatternDlg( QWidget*,\r
65                                                          SALOME_Selection*,\r
66                                                          const int,\r
67                                                          const char* = 0 );\r
68   virtual                     ~SMESHGUI_CreatePatternDlg();\r
69 \r
70   void                        Init( SALOME_Selection*, const int );\r
71   QString                     GetPatternName() const;\r
72   SMESH::SMESH_Pattern_ptr    GetPattern();\r
73   void                        SetMesh( SMESH::SMESH_Mesh_ptr );\r
74   \r
75 signals:\r
76 \r
77   void                        NewPattern();\r
78   void                        Close();\r
79     \r
80 private:\r
81 \r
82   void                        closeEvent( QCloseEvent* e ) ;\r
83   void                        enterEvent ( QEvent * ) ;            \r
84   \r
85 private slots:\r
86 \r
87   void                        onOk();\r
88   void                        onSave();\r
89   void                        onClose();\r
90 \r
91   void                        onDeactivate();\r
92 \r
93   void                        onSelectionDone();\r
94   void                        onTypeChanged( int );\r
95   void                        onProject( bool );\r
96   void                        onSelBtnClicked();\r
97 \r
98 private:\r
99 \r
100   QFrame*                     createButtonFrame( QWidget* );\r
101   QFrame*                     createMainFrame  ( QWidget* );\r
102   void                        displayPreview();\r
103   void                        erasePreview();\r
104   void                        activateSelection();\r
105   QString                     autoExtension( const QString& theFileName ) const;\r
106   bool                        isValid();\r
107   bool                        loadFromObject( const bool = true );\r
108   QString                     getDefaultName() const;\r
109   GEOM::GEOM_Object_ptr       getGeom( SALOMEDS::SObject_ptr );\r
110 \r
111 private:\r
112 \r
113   QPushButton*                myOkBtn;\r
114   QPushButton*                mySaveBtn;\r
115   QPushButton*                myCloseBtn;\r
116 \r
117   QButtonGroup*               myTypeGrp;\r
118   QRadioButton*               mySwitch2d;\r
119   QRadioButton*               mySwitch3d;\r
120   QRadioButton*               mySwitchSMESH_Pattern3d;\r
121 \r
122   QLineEdit*                  myMeshEdit;\r
123   QLineEdit*                  myName;\r
124 \r
125   SMESHGUI_PatternWidget*     myPicture2d;\r
126   \r
127   QCheckBox*                  myProjectChk;\r
128     \r
129   SALOME_Selection*           mySelection;\r
130   int                         myNbPoints;\r
131   int                         myType;\r
132 \r
133   SMESH::SMESH_Mesh_var       myMesh;\r
134   SMESH::SMESH_subMesh_var    mySubMesh;\r
135   GEOM::GEOM_Object_var       myGeomObj;\r
136 \r
137   SMESH::SMESH_Pattern_var    myPattern;\r
138   bool                        myIsLoaded;\r
139 };\r
140 \r
141 #endif\r
142 \r
143 \r
144 \r
145 \r
146 \r
147 \r
148 \r
149 \r
150 \r
151 \r
152 \r
153 \r
154 \r
155 \r
156 \r
157 \r
158 \r