Salome HOME
1) IPAL15174 (Dump study works wrong for Concatenate):
[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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 "SMESHGUI_Dialog.h"
31 #include "SMESHGUI_SelectionOp.h"
32
33 // IDL Headers
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(GEOM_Gen)
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37
38 class QCloseEvent;
39 class QFrame;
40 class QLineEdit;
41 class QPushButton;
42 class LightApp_SelectionMgr;
43 class SVTK_ViewWindow;
44 class QButtonGroup;
45 class SMESHGUI;
46
47 /*!
48  * \brief Dialog to publish a sub-shape of the mesh main shape
49  *        by selecting mesh elements
50  */
51
52 class SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog
53 {
54   Q_OBJECT
55
56 public:
57                            SMESHGUI_ShapeByMeshDlg();
58   virtual                  ~SMESHGUI_ShapeByMeshDlg();
59
60 private:
61
62   QFrame*                  createMainFrame   (QWidget*);
63
64   QButtonGroup*            myElemTypeGroup;
65   QLineEdit*               myElementId;
66   QLineEdit*               myGeomName;
67
68   bool                     myIsMultipleAllowed;
69   void                     setMultipleAllowed(bool isAllowed) {myIsMultipleAllowed = isAllowed;};
70
71   friend class SMESHGUI_ShapeByMeshOp;
72 };
73
74 /*!
75  * \brief Operation to publish a sub-shape of the mesh main shape
76  *        by selecting mesh elements
77  */
78 class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp
79 {
80   Q_OBJECT
81
82 public:
83   SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed = false);
84   virtual ~SMESHGUI_ShapeByMeshOp();
85
86   virtual LightApp_Dialog*       dlg() const;  
87
88   void                     Init();
89   void                     SetMesh (SMESH::SMESH_Mesh_ptr);
90   SMESH::SMESH_Mesh_ptr    GetMesh () { return myMesh; }
91   GEOM::GEOM_Object_ptr    GetShape();
92
93 protected:
94
95   virtual void                   commitOperation();
96   virtual void                   startOperation();
97
98   void                     activateSelection();
99   void                     setElementID(const QString&);
100
101 protected slots:
102
103   virtual bool                   onApply() { return true; }
104
105 private slots:
106
107   void                     onSelectionDone();
108   void                     onTypeChanged (int);
109   void                     onElemIdChanged (const QString&);
110
111 private:
112
113   SMESHGUI_ShapeByMeshDlg* myDlg;
114   SMESH::SMESH_Mesh_var    myMesh;
115   GEOM::GEOM_Object_var    myGeomObj;
116
117   bool                     myIsManualIdEnter;
118   bool                     myHasSolids;
119   bool                     myIsMultipleAllowed;
120 };
121
122 #endif