1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_ShapeByMeshDlg.h
23 // Author : Edward AGAPOV
26 #ifndef SMESHGUI_ShapeByMeshDlg_H
27 #define SMESHGUI_ShapeByMeshDlg_H
29 #include "SMESH_SMESHGUI.hxx"
31 #include "SMESHGUI_Dialog.h"
32 #include "SMESHGUI_SelectionOp.h"
35 #include <SALOMEconfig.h>
36 #include CORBA_SERVER_HEADER(GEOM_Gen)
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
43 class LightApp_SelectionMgr;
44 class SVTK_ViewWindow;
49 * \brief Dialog to publish a sub-shape of the mesh main shape
50 * by selecting mesh elements
53 class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog
58 SMESHGUI_ShapeByMeshDlg();
59 virtual ~SMESHGUI_ShapeByMeshDlg();
63 QFrame* createMainFrame (QWidget*);
65 QButtonGroup* myElemTypeGroup;
66 QLineEdit* myElementId;
67 QLineEdit* myGeomName;
69 bool myIsMultipleAllowed;
70 void setMultipleAllowed(bool isAllowed) {myIsMultipleAllowed = isAllowed;};
72 friend class SMESHGUI_ShapeByMeshOp;
76 * \brief Operation to publish a sub-shape of the mesh main shape
77 * by selecting mesh elements
79 class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp
84 SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed = false);
85 virtual ~SMESHGUI_ShapeByMeshOp();
87 virtual LightApp_Dialog* dlg() const;
90 void SetMesh (SMESH::SMESH_Mesh_ptr);
91 SMESH::SMESH_Mesh_ptr GetMesh () { return myMesh; }
92 GEOM::GEOM_Object_ptr GetShape();
96 virtual void commitOperation();
97 virtual void startOperation();
99 void activateSelection();
100 void setElementID(const QString&);
104 virtual bool onApply() { return true; }
108 void onSelectionDone();
109 void onTypeChanged (int);
110 void onElemIdChanged (const QString&);
114 SMESHGUI_ShapeByMeshDlg* myDlg;
115 SMESH::SMESH_Mesh_var myMesh;
116 GEOM::GEOM_Object_var myGeomObj;
118 bool myIsManualIdEnter;
120 bool myIsMultipleAllowed;