Salome HOME
Merge from OCC_development_generic_2006
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ShapeByMeshDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 //
20 //
21 //
22 //  File   : SMESHGUI_ShapeByMeshDlg.h
23 //  Author : Edward AGAPOV
24 //  Module : SMESH
25
26
27 #ifndef SMESHGUI_ShapeByMeshDlg_H
28 #define SMESHGUI_ShapeByMeshDlg_H
29
30 #include <qdialog.h>
31
32 // IDL Headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(GEOM_Gen)
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36
37 class QCloseEvent;
38 class QFrame;
39 class QLineEdit;
40 class QPushButton;
41 class LightApp_SelectionMgr;
42 class SVTK_ViewWindow;
43 class QButtonGroup;
44 class SMESHGUI;
45
46 /*!
47  * \brief Dialog to publish a sub-shape of the mesh main shape
48  *        by selecting mesh elements
49  */
50
51 class SMESHGUI_ShapeByMeshDlg : public QDialog
52 {
53   Q_OBJECT
54
55 public:
56                            SMESHGUI_ShapeByMeshDlg( SMESHGUI*   theModule,
57                                                     const char* theName = 0);
58   virtual                  ~SMESHGUI_ShapeByMeshDlg();
59
60   void                     Init();
61   void                     SetMesh (SMESH::SMESH_Mesh_ptr);
62   SMESH::SMESH_Mesh_ptr    GetMesh () { return myMesh; }
63   GEOM::GEOM_Object_ptr    GetShape();
64
65 signals:
66
67   void                     PublishShape();
68   void                     Close();
69
70 private:
71
72   void                     closeEvent (QCloseEvent* e);
73   void                     enterEvent (QEvent*);
74
75 private slots:
76
77   void                     onOk();
78   void                     onClose();
79
80   void                     onDeactivate();
81
82   void                     onSelectionDone();
83   void                     onTypeChanged (int);
84   void                     onElemIdChanged (const QString&);
85
86 private:
87
88   QFrame*                  createButtonFrame (QWidget*);
89   QFrame*                  createMainFrame   (QWidget*);
90   //void                     displayPreview();
91   //void                     erasePreview();
92   void                     activateSelection();
93   void                     setElementID(const QString&);
94
95 private:
96
97   QButtonGroup*            myElemTypeGroup;
98   QLineEdit*               myElementId;
99   QLineEdit*               myGeomName;
100
101   QPushButton*             myOkBtn;
102   QPushButton*             myCloseBtn;
103
104   SMESHGUI*                mySMESHGUI;
105   LightApp_SelectionMgr*   mySelectionMgr;
106   SVTK_ViewWindow*         myViewWindow;
107
108   SMESH::SMESH_Mesh_var    myMesh;
109   GEOM::GEOM_Object_var    myGeomObj;
110
111   bool                     myIsManualIdEnter;
112   bool                     myHasSolids;
113 };
114
115 #endif